/*
 *      Author: Guannan Ma
 *      @mythmgn
 *      Whatever license applied
 */
#include "base.h"

#ifndef BASE_LIB_LIB_NETUTIL_H
#define BASE_LIB_LIB_NETUTIL_H

typedef int SOCKET;

#ifdef	__cplusplus
extern "C"
{
#endif

/*Authentication */

#define AUTH_SUCCESS 0
#define ERR_USER_NOT_EXISTING 1
#define ERR_USER_WRONG_PW 2


inline int setNonBlockingFD(int fd);
inline BOOL setTcpSocketKeepAlive(SOCKET s, int idle, int intvl, int count); 
inline BOOL setSocketLingerOff(SOCKET s);
inline BOOL setSocketReuseAddr(SOCKET s);
inline BOOL setSocketNoDelay(SOCKET s);
inline BOOL setSocketQuickAck(SOCKET s, BOOL enable);

#ifdef	__cplusplus
}
#endif

#endif /* BASE_LIB_LIB_NETUTIL_H */
